<template>
<div style="width: 100%">
    <el-form :model="formData" :rules="rules" ref="form" label-width="100px" style="width: 100%">
        <el-form-item label="父名称">
            <el-input v-model="formData.FPDESC" disabled />
        </el-form-item>
        <el-form-item label="货架名称" prop="FDESC">
            <el-input v-model="formData.FDESC" @change="descChange" maxlength="25" />
        </el-form-item>
        <el-form-item label="货架类型" prop="FTYPE">
            <el-select v-model="formData.FTYPE">
                <el-option label="常温" value="常温"></el-option>
                <el-option label="阴凉" value="阴凉"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="值" prop="FVALUE">
            <el-input v-model="formData.FVALUE" maxlength="25" :disabled="formData.FPID=='-1'" />
        </el-form-item>
        <el-form-item label="备注">
            <el-input v-model="formData.FNOTE" type="textarea" maxlength="100" />
        </el-form-item>
    </el-form>
</div>
</template>

<script>
import baseView from "@/views/base";
import {utils} from "hi-ui";

export default {
    name: "basicdatadetail",
    extends: baseView,
    components: {},
    data() {
        return {
            rules: {
                FDESC: [{
                    required: true,
                    message: "名称不能为空!",
                    trigger: "blur",
                }, ],
                FVALUE: [{
                    required: true,
                    message: "值不能为空!",
                    trigger: "blur",
                }, ],
            },
        };
    },
    model: {
        prop: "formData",
        event: "valuechange",
    },
    props: {
        formData: {
            type: Object,
            // default:function(){return {}}
        },
    },

    computed: {},
    watch: {},
    methods: {
        descChange(val){
            this.formData.FVALUE = utils.string.getPinyin(val);
        },
        validate(callback) {
            this.$refs["form"].validate(callback);
        },
    },
    mounted() {},
};
</script>

<style rel="stylesheet/scss" lang="scss" scope>
</style>
